<?php

namespace App\Validators\Mysql;

class AuthorValidator extends \GordenSong\Support\TableValidator
{
	protected $connection = 'mysql';
	protected $table = 'author';

	public function customizeRules(): array
	{
		return [
			'id' => ['required'],
			'name' => ['required'],
			'age' => ['required'],
			'created_at' => [],
			'updated_at' => [],
		];
	}

	public function excludeRules(): array
	{
		return [
			'created_at',
			'updated_at',
		];
	}

	protected $messages = [
		'age.max' => ':attribute必须小于:max',
	];

	protected $attributes = [
		'name' => '姓名',
		'age' => '年龄',
	];

	protected $scenes = [

	];
}
